package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2018/1/3
 */
@Entity
@DynamicInsert
@Table(name = "sign_in_award_base")
public class SignInAwardBaseEntity extends BaseEntity{
    public enum SignInAwardBaseEntity_{
        code
    }
    private Integer dayStep;
    private String couldLoopDraw;
    private String value;
    private String description;
    private String code;
    private String type;


    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "day_step")
    public Integer getDayStep() {
        return dayStep;
    }

    public void setDayStep(Integer dayStep) {
        this.dayStep = dayStep;
    }

    @Basic
    @Column(name = "is_continuous")
    public String getCouldLoopDraw() {
        return couldLoopDraw;
    }

    public void setCouldLoopDraw(String isContinuous) {
        this.couldLoopDraw = isContinuous;
    }

    @Basic
    @Column(name = "value")
    public String getValue() {
        return value;
    }

    public void setValue(String rule) {
        this.value = rule;
    }

    @Basic
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {

        this.description = description;
    }
    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SignInAwardBaseEntity that = (SignInAwardBaseEntity) o;

        if (dayStep != null ? !dayStep.equals(that.dayStep) : that.dayStep != null) return false;
        if (couldLoopDraw != null ? !couldLoopDraw.equals(that.couldLoopDraw) : that.couldLoopDraw != null) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        return type != null ? type.equals(that.type) : that.type == null;
    }

    @Override
    public int hashCode() {
        int result = dayStep != null ? dayStep.hashCode() : 0;
        result = 31 * result + (couldLoopDraw != null ? couldLoopDraw.hashCode() : 0);
        result = 31 * result + (value != null ? value.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        return result;
    }
}
